package com.lch.netty.bio.tomcat.http;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;

import io.netty.util.internal.StringUtil;
import lombok.Data;

/**
 * @author: liuchenhui
 * @create: 2019-10-14 11:44
 **/
@Data
public class Request {

    private String method;
    private InputStream inputStream;
    private String url;

    public Request(InputStream inputStream) throws IOException {
        byte[] bytes = new byte[10240];
        inputStream.read(bytes);

        String s = new String(bytes, "UTF-8");
        System.out.println(s);
//        String baseInfo = s.split("\n")[0];
//        String method = baseInfo.split(" ")[0];
//        String url = baseInfo.split(" ")[1];
//        this.setUrl("123");
//        this.setMethod("123");
    }

    public String getMethod() {
        return method;
    }

    public String getUrl() {
        return url;
    }
}
